package com.cart.protocol;

/**
 * Created by lixiaodaoaaa on 2017/8/16.
 */

public interface ProtocolDefine {
    int ONE_BYTE_LEN = 2;
    //报头
    String HEADER = "BA";
    //报尾
    String END = "ED";
    //设备类型统一FF
    String DEVICE_TYPE = "FF";

    //命令字的 发送
    interface CommandWordSend {
        String ACTION = "02";
        String READ = "01";
    }

    //读取  命令字 的应答
    interface CommandWordRes {
        int length = 2;
        //命令字 操作成功
        String ACTION_SUCCESS = "20";
        String ACTION_FAIL = "2F";

        String READ_SUCCESS = "10";
        String READ_FAIL = "1F";
    }

    //ModuleName  = ModuleType+ModuleNumber
    //用 moduleType 和moduleNumber确定具体的module类型
    interface ModuleName {

        int length = 4;//定长字节4

        String SYSTEM_POWER = "0003";

        String DOOR = "0501";

        String OXYGEN = "0401";

        String CO2 = "0402";

        String ROCKING_VALVE = "0A03";

        String ULTRAVIOLET = "0901";

        String TEMPERATURE = "0301";

        String SALINE_VALVE = "0A02";

        String MAGNETIC_STIRRER = "0201";


        //region ✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨
        //读取 进液泵✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨
        //读取 循环泵✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨
        //读取 废液泵✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨
        //读取 回收泵✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨
        String FEED_LIQUOR_PUMP = "0101";
        String CIRCULATING_PUMP = "0102";
        String WASTE_LIQUOR_PUMP = "0103";
        String RECYCLING_PUMP = "0104";
        //endregion ✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨


        //培养基管阀
        String CULTURE_MEDIUM_VALVE = "020A";

        //培养箱 换气泵
        String INCUBATOR_AIR_EXCHAGNE_PUMP = "0802";

        //培养罐 换气泵
        String CULTURE_TANK_AIR_EXCHANGE_PUMP = "0801";

        //液位状态
        String LIQUID_LEVEL = "0701";

        //电子秤
        String ELECTRONIC_BALANCE = "0601";
    }


    interface OperateCommand {
        String OPEN = "CC";
        String READ = "FF";
        String CLOSE = "AA";
        String STOP = "DD";
        String SET = "BB";
        String POWER_OFF = "BB";
    }

    interface CommandContent {
        String OXYGEN = "00";
        String DOOR = "00";
        String BLANK = "00";
        String NOTING = "00";
    }

    interface DoorStatus {
        String DOOR_OPEN_HALF = "00";
        String DOOR_CLOSE = "01";
        String DOOR_OPEN_BIGGEST = "02";
    }

    interface LiquidLevelStatus {
        String NORMAL = "01";
        String ABNORMAL = "00";
    }

}
